<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app"></div>
    <script src="../../element.js"></script>
    <script>
        html.h1('这是一个标题')
            .render('#app');
        html.br()
            .render('#app');
        html.a('这是一个链接')
            .href('https://www.baidu.com')
            .onclick(function(event) {
                event.preventDefault();
                alert('这是一个链接：' + this.element.getAttribute('href'));
            })
            .render('#app');
    </script>
</body>
</html>